package org.apache.p;

/**
 * @ClassName:aaa
 * @author: bbb
 * @Description: TODO
 * data:2024/3/20 22:55
 * @since
 **/
public class TestMyException {


    public static void main(String args[]){
        try {
            testerr(0);
        }catch (MyException e ){
            System.out.println(e.getMessage());
        }catch(Exception e){
            System.out.println(e.getMessage());
        }finally {
            System.out.println("这是finally");
        }

    }


    public static void testerr(int a) throws Exception{
        try{
            if(a <0){
                throw new MyException("我的错：小于0了");
            }else if (a ==0){
                throw new MyException("我的错：等于0了");
            }else {
                throw new MyException("我的错：大于0了");
            }
        }finally {
            System.out.println("吊毛，这是testerr的finally");
        }



    }
}
